package com.meowcook.pojo.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Max;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.List;

@ApiModel(value = "发布食谱参数")
@Data
public class RecipeAddDTO {

    @NotNull
    @ApiModelProperty(value = "板块id", required = true)
    private Long boardId;

    @Length(max = 20, min = 1, message = "标题不能超过20字，不能少于5字")
    @NotNull
    @ApiModelProperty(value = "标题，不能超过20字，不能少于5字", required = true)
    private String name;

    @Length(max = 300, message = "描述不能超过300字")
    @NotBlank
    @ApiModelProperty(value = "描述，不能超过300字", required = true)
    private String description;

    @NotNull
    @ApiModelProperty(value = "难度，1-5星级", required = true)
    private Byte difficulty;

    @Max(120)
    @NotNull
    @ApiModelProperty(value = "可用餐人数，不能超过120人", required = true)
    private Byte servings;

    @Length(max = 80, message = "提示不能超过80字")
    @ApiModelProperty(value = "小提示，不能超过80字，用户可选择，非必传项")
    private String tips;

    @ApiModelProperty(value = "食谱图片路径, 非必传项")
    private String coverImage;

    @NotNull
    @Size(min = 1, message = "至少需要一个步骤")
    @ApiModelProperty(value = "步骤，至少需要一个步骤", required = true)
    private List<CookingAddDTO> cookingDTOS;

    @NotNull
    @Size(min = 1, message = "至少需要一种食材")
    @ApiModelProperty(value = "食材，至少需要一种食材", required = true)
    private List<MaterialAddDTO> materialDTOS;

    @NotNull
    @Size(min = 1, message = "至少需要一个厨具")
    @ApiModelProperty(value = "厨具，至少需要一个厨具", required = true)
    private List<CookerAddDTO> cookerDTOS;
}